package com.itheima.web.controller;

import java.io.Serializable;

/**
 * @program: mm_exam_review
 * @description:
 * @author: zhanghz001
 * @create: 2020-11-16 10:19
 **/
public class Result implements Serializable {
    private static final long serialVersionUID = -3676069465382392867L;

    private int code;
    private Object data;
    private boolean flag;
    private String message;

    public Result() {
    }

    public Result(Object data, String message) {
        this.data = data;
        this.message = message;
        this.code = Code.SUCCESS;
        this.flag = true;
    }

    public Result(int code, Object data, String message, boolean flag) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.flag = flag;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", data=" + data +
                ", flag=" + flag +
                ", message='" + message + '\'' +
                '}';
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
